﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Bas0a10
    {
        private int? _valuecode;
		private string _valuename;
		private string _fax;
		private string _ntel;
		private string _principalname;
		private string _usercode;
		private string _address1;
		private string _address2;
        private int? _statuscode;
		private string _statusname;
		private string _um;
		private string _listid;
		
        /// <summary>
        /// 物流公司代码
        /// </summary>
		public int? Valuecode
		{
			get { return _valuecode;	 }
			set { _valuecode=value;	}
		}
        /// <summary>
        /// 名称
        /// </summary>
		public string Valuename
		{
			get { return _valuename;	 }
			set { _valuename=value;	}
		}
        /// <summary>
        /// 传真
        /// </summary>
		public string Fax
		{
			get { return _fax;	 }
			set { _fax=value;	}
		}
        /// <summary>
        /// 联系电话
        /// </summary>
		public string Ntel
		{
			get { return _ntel;	 }
			set { _ntel=value;	}
		}
        /// <summary>
        /// 联系人
        /// </summary>
		public string Principalname
		{
			get { return _principalname;	 }
			set { _principalname=value;	}
		}
        /// <summary>
        /// 用户名
        /// </summary>
		public string Usercode
		{
			get { return _usercode;	 }
			set { _usercode=value;	}
		}
        /// <summary>
        /// 收货地址1
        /// </summary>
		public string Address1
		{
			get { return _address1;	 }
			set { _address1=value;	}
		}
        /// <summary>
        /// 收货地址2
        /// </summary>
		public string Address2
		{
			get { return _address2;	 }
			set { _address2=value;	}
		}
        /// <summary>
        /// 状态代码
        /// </summary>
		public int? Statuscode
		{
			get { return _statuscode;	 }
			set { _statuscode=value;	}
		}
        /// <summary>
        /// 状态名称
        /// </summary>
		public string Statusname
		{
			get { return _statusname;	 }
			set { _statusname=value;	}
		}
        /// <summary>
        /// 计量单位
        /// </summary>
		public string Um
		{
			get { return _um;	 }
			set { _um=value;	}
		}
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
		
		public static List<Bas0a10> GetBas0a10ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Bas0a10> list = new List<Bas0a10>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Bas0a10 model = GetBas0a10ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Bas0a10 GetBas0a10ByDataRow(DataRow dr)
		{
			Bas0a10 model = new Bas0a10(); //实例化Bas0a10
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("valuecode")&&!(dr["valuecode"] is System.DBNull))  
				model.Valuecode = ( int)dr["valuecode"];
			if (dcc.Contains("valuename")&&!(dr["valuename"] is System.DBNull))  
				model.Valuename = ( string)dr["valuename"];
			if (dcc.Contains("fax")&&!(dr["fax"] is System.DBNull))  
				model.Fax = ( string)dr["fax"];
			if (dcc.Contains("ntel")&&!(dr["ntel"] is System.DBNull))  
				model.Ntel = ( string)dr["ntel"];
			if (dcc.Contains("principalname")&&!(dr["principalname"] is System.DBNull))  
				model.Principalname = ( string)dr["principalname"];
			if (dcc.Contains("usercode")&&!(dr["usercode"] is System.DBNull))  
				model.Usercode = ( string)dr["usercode"];
			if (dcc.Contains("address1")&&!(dr["address1"] is System.DBNull))  
				model.Address1 = ( string)dr["address1"];
			if (dcc.Contains("address2")&&!(dr["address2"] is System.DBNull))  
				model.Address2 = ( string)dr["address2"];
			if (dcc.Contains("statuscode")&&!(dr["statuscode"] is System.DBNull))  
				model.Statuscode = ( int)dr["statuscode"];
			if (dcc.Contains("statusname")&&!(dr["statusname"] is System.DBNull))  
				model.Statusname = ( string)dr["statusname"];
			if (dcc.Contains("um")&&!(dr["um"] is System.DBNull))  
				model.Um = ( string)dr["um"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			
			return model;
		}
    }
}
